package net.stratusprogramming.school.Game.Framework.Items;

import net.stratusprogramming.school.Game.Framework.Battle.Combatant;

public class Potion extends Usable	{
	
	/** Effect of the potion */
	protected Effect effect;
	
	/**
	 * Creates a new potion
	 */
	public Potion() {
		
	}
	
	/**
	 * Constructor for the potion class and class that defines all objects potion
	 * 
	 * @param name name of potion
	 * @param value 
	 * @param weight
	 * @param maxUses
	 * @param changes
	 */
	public Potion(String name, int value, float weight, int maxUses, Effect effect)	{
		super(name, value, weight, 1);
		this.effect = effect;
		this.maxUses = 1;
	}

	/**
	 * Use the potion on a combatant
	 * 
	 * @param combatant combatant to use potion on
	 */
	public boolean use(Combatant combatant) {
		if(super.use(combatant)) {
			effect.affect(combatant);
			return true;
		} else return false;
	}

	/**
	 * @return the effect
	 */
	public Effect getEffect() {
		return effect;
	}
	/**
	 * @param effect the effect to set
	 */
	public void setEffect(Effect effect) {
		this.effect = effect;
	}	
}
